package com.zjp.service.impl;

import com.zjp.mapper.DetectionPointMapper;
import com.zjp.pojo.DetectionPoint;
import com.zjp.service.DetectionPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DetectionPointServiceImpl implements DetectionPointService {


    @Autowired
    private DetectionPointMapper detectionPointMapper;
    /**
     * 查询所有核酸检测点返回到页面上
     * @return
     */
    public List<DetectionPoint> findAllDetectionPoint() {
        return detectionPointMapper.selectByExample(null);
    }

    /**
     * 添加检测点
     * @param detectionPoint
     * @return
     */
    public int addDetectionPoint(DetectionPoint detectionPoint) {
        return detectionPointMapper.insert(detectionPoint);
    }

    /**
     * 修改检查点
     */
    public int updateDPoint(DetectionPoint detectionPoint) {
        return detectionPointMapper.updateByPrimaryKey(detectionPoint);
    }

    /**
     * 删除检查点
     */
    public int deleteDPointById(Integer detectionid) {
        return detectionPointMapper.deleteByPrimaryKey(detectionid);
    }
}
